@ECHO OFF

ECHO.
ECHO FAH MSI Build Script version 1, Copyright (C) 2005 David Rawling.
ECHO The FAH MSI Build Script and associated files and data come with
ECHO ABSOLUTELY NO WARRANTY; for details please use the command 
ECHO %0 NOWARR.  This is free software, and you are welcome
ECHO to redistribute it under certain conditions; type
ECHO %0 COND for details.
ECHO.

IF "%1"=="NOWARR" GOTO NOWARRANTY
IF "%1"=="COND" GOTO CONDITIONS
IF "%WIXHOME%" == "" GOTO WIXUSAGE

DEL *.WiXObj

SET LIGHTSRC=FAHService.WiXObj
SET LIGHTCMD="%WIXHOME%\ca\wixca.wixlib" "%WIXHOME%\lib\wixui_featuretree.wixlib" -loc "%WIXHOME%\lib\WixUI_en-us.wxl" -v3 -pedantic:legendary -nologo -out

FOR /L %%f in (1,1,8) DO ECHO Building Instance 0%%f ... && "%WIXHOME%\Candle" FAHService.WXS -dINST=%%f -nologo && "%WIXHOME%\Light" %LIGHTSRC% %LIGHTCMD% FAHService-0%%f.MSI

GOTO QUIT

:WIXUSAGE
ECHO.
ECHO The WIXHOME variable needs to be set to the directory into which the WiX binaries were extracted.
GOTO QUIT

:NOWARRANTY

ECHO BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR
ECHO THE PROGRAM,TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
ECHO OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
ECHO PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
ECHO EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
ECHO WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE
ECHO ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU.
ECHO SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY
ECHO SERVICING, REPAIR OR CORRECTION. 
ECHO.
ECHO IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
ECHO WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
ECHO REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR
ECHO DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL
ECHO DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM
ECHO (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED
ECHO INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE
ECHO OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH
ECHO HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
ECHO DAMAGES. 
ECHO.

GOTO QUIT

:CONDITIONS

GOTO QUIT

:QUIT